#include <sync.h>
#include <error.h>
#include <bite_scaffold/log.h>

namespace svc_file
{
    class CacheDelete : public vp_sync::CacheSync
    {
        private:
            std::shared_ptr<sw::redis::Redis> redis_;
            bitemq::publisher::ptr publisher_;
            bitemq::subscriber::ptr subscriber_;
            void callback(const char* body,size_t len);
        public:
            using ptr = std::shared_ptr<CacheDelete>;
            CacheDelete(const std::shared_ptr<sw::redis::Redis>& redis, 
                        const bitemq::MQClient::ptr& mq_client,
                        const bitemq::declare_settings& declare_settings);

            virtual void sync(const std::string& cache_key) override;
            ~CacheDelete();
    };
}